home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CUJ9209.ARJ / 1009113B < prev    next >
Text File  |  1992-07-13  |  516b  |  21 lines

  1. main()
  2.    {
  3.    static void (*array[])() = {dummy1, dummy2, dummy3};
  4.    int i;
  5.    int number_functions = sizeof(array)/sizeof(void (*)());
  6.    void (**pointer_to_function_pointer)();
  7.  
  8.    /* Array subscripts */
  9.    for (i = 0; i < number_functions; i++)
  10.        {
  11.        (*array[i])();
  12.        }
  13.  
  14.    /* Pointer version */
  15.    pointer_to_function_pointer = array;
  16.    for (i = 0; i < number_functions; i++)
  17.        {
  18.        (**pointer_to_function_pointer)();
  19.        pointer_to_function_pointer++;
  20.        }
  21.